*Master do file 
*You must run the preamble for any of the code to run

*enter your main directory here:
gl root "C:\Users\vmoorthy\Documents\Replication Package"

*************************************************************
***PREAMBLE
*************************************************************
clear all
gl do "$root/do"
gl tmp "$root/dta"
gl out "$root/out"
gl outappend "$root/out/appendix"
set maxvar 10000

*set globals for regressions
glo rhs c.medianhhinc1990#i.year c.pcthighschool1990#i.year c.pctmanufacturing1990#i.year c.pctmarried1990#i.year c.pctrural1990#i.year c.pctveteran1990#i.year c.pctwhite11990#i.year
glo main "[aw = pop2000] if  balancesample == 1, absorb(splay1_year_fe cntyfips2000) vce(cl cntyfips2000)"

*drop Bakken shale play: Montana and North Dakota observations
glo restrict "[aw = pop2000] if sfips2000 != "38" & sfips2000 != "30" & balancesample == 1, absorb(splay1_year_fe cntyfips2000) vce(cl cntyfips2000)"

*create program to make event study graphs
run "$do/eventstudy_program"
run "$do/eventstudy_statespec"

*************************************************************
***Analysis
*************************************************************

*Reproduce all tables in the main text
do "$do/Tables.do"

*Reproduce all figures in the main text
do "$do/Figures.do"

*************************************************************
***Online Appendix
*************************************************************

*Reproduce online appendix tables
do "$do/Appendix Tables.do"

*Reproduce online appendix figures
do "$do/Appendix Figures.do"
